#lang sicp 

(define (cube-root x)
  (define (iter guess x)
    (if (good-enough? guess x)
        guess
        (iter (improve guess x) x)))
  
  (define (cube x) (* x x x))

  (define (good-enough? guess x)
    (< (abs (- (cube guess)
               x))
       0.001))
  
  (define (improve guess x)
    (/ (+ (/ x guess guess) guess guess) 3.0))
  
  (iter 1.0 x))